home *** CD-ROM | disk | FTP | other *** search
/ How Many Bugs in a Box / How Many Bugs in a Box.cdr / bugs / act5 / 00385_run time tools.ls < prev    next >
Encoding:
Text File  |  1995-03-28  |  3.3 KB  |  118 lines

  1. on mydelay putz
  2.   set ptime to the timer + putz
  3.   repeat while the timer < ptime
  4.     if the mouseDown then
  5.       exit repeat
  6.     end if
  7.   end repeat
  8. end
  9.  
  10. on smovespecial sold, stime, param
  11.   global stinktime
  12.   set sx to the locH of sprite sold
  13.   set stime to the timer + (stime * 1.0)
  14.   set ptimer to the timer
  15.   set dx to getAt(param, 1)
  16.   set xinc to (dx - sx) / (stime - ptimer)
  17.   repeat while the timer < stime
  18.     set ptime to the timer - ptimer
  19.     set the locH of sprite sold to sx + (xinc * ptime)
  20.     updateStage()
  21.     if the timer < stinktime then
  22.       set the castNum of sprite 26 to the number of cast ("hed" & random(3))
  23.     end if
  24.   end repeat
  25.   set the locH of sprite sold to dx
  26.   updateStage()
  27. end
  28.  
  29. on smove sold, stime, param
  30.   set sx to the locH of sprite sold
  31.   set sy to the locV of sprite sold
  32.   set stime to stime * 1.0
  33.   set dx to getAt(param, 1)
  34.   set dy to getAt(param, 2)
  35.   set xinc to (dx - sx) / stime
  36.   set yinc to (dy - sy) / stime
  37.   startTimer()
  38.   repeat while the timer < stime
  39.     set ptime to the timer
  40.     set the locH of sprite sold to sx + (xinc * ptime)
  41.     set the locV of sprite sold to sy + (yinc * ptime)
  42.     set the castNum of sprite 26 to the number of cast ("hed" & random(3))
  43.     updateStage()
  44.   end repeat
  45.   set the locH of sprite sold to dx
  46.   set the locV of sprite sold to dy
  47.   updateStage()
  48. end
  49.  
  50. on smovenoanim sold, stime, param
  51.   set sx to the locH of sprite sold
  52.   set sy to the locV of sprite sold
  53.   set stime to stime * 1.0
  54.   set dx to getAt(param, 1)
  55.   set dy to getAt(param, 2)
  56.   set xinc to (dx - sx) / stime
  57.   set yinc to (dy - sy) / stime
  58.   set rubtime to the timer
  59.   repeat while the timer < (stime + rubtime)
  60.     set ptime to the timer - rubtime
  61.     set the locH of sprite sold to sx + (xinc * ptime)
  62.     set the locV of sprite sold to sy + (yinc * ptime)
  63.     updateStage()
  64.   end repeat
  65.   set the locH of sprite sold to dx
  66.   set the locV of sprite sold to dy
  67.   updateStage()
  68. end
  69.  
  70. on sdeact params
  71.   if not listp(params) then
  72.     set the locV of sprite params to -(the locV of sprite params)
  73.     puppetSprite(params, 1)
  74.   else
  75.     set num to count(params)
  76.     repeat with xxx = 1 to num
  77.       set snum to getAt(params, xxx)
  78.       set the locV of sprite snum to -(the locV of sprite snum)
  79.       puppetSprite(snum, 0)
  80.     end repeat
  81.     updateStage()
  82.   end if
  83. end
  84.  
  85. on sactivate sold, params
  86.   puppetSprite(sold, 1)
  87.   if listp(params) then
  88.     set the locH of sprite sold to getAt(params, 1)
  89.     set the locV of sprite sold to getAt(params, 2)
  90.     set the type of sprite sold to getAt(params, 3)
  91.     set the castNum of sprite sold to getAt(params, 4)
  92.     set the ink of sprite sold to getAt(params, 5)
  93.     set the foreColor of sprite sold to getAt(params, 6)
  94.     set the backColor of sprite sold to getAt(params, 7)
  95.     set the visible of sprite sold to getAt(params, 8)
  96.   end if
  97. end
  98.  
  99. on ssetpos sold, params
  100.   set the locH of sprite sold to getAt(params, 1)
  101.   set the locV of sprite sold to getAt(params, 2)
  102. end
  103.  
  104. on sinfo sold
  105.   set stemp to list(the locH of sprite sold, the locV of sprite sold, the type of sprite sold)
  106.   add(stemp, the castNum of sprite sold)
  107.   add(stemp, the ink of sprite sold)
  108.   add(stemp, the foreColor of sprite sold)
  109.   add(stemp, the backColor of sprite sold)
  110.   add(stemp, the visible of sprite sold)
  111.   return stemp
  112. end
  113.  
  114. on sgetpos sold
  115.   set stemp to list(the locH of sprite sold, the locV of sprite sold)
  116.   return stemp
  117. end
  118.